<?php

namespace application\model;

use application\model\BaseModel;
use application\entity\db\Site;
use core\entity\Criteria;
use core\entity\Query;

class SiteModel extends BaseModel {

    public function __construct() {
        parent::__construct(Site::class);
    }

    /**
     * Tìm kiếm web theo domain
     * @param type $domain
     * @return type
     */
    public function findByDomain($domain) {
        $cri = new Criteria();
        $cri->andKey("domain")->regex($domain);
        $query = new Query($cri);
        return $this->ifind($query);
    }

}
